<html>
<head>
<title>Mesa OpenGL Demo</title>

<script type="text/javascript">
  var mesagl = {};

  function moduleDidLoad() {
    mesagl.module = document.getElementById('mesagl');
    if (mesagl.module != null) {
      mesagl.updateInterval = setInterval("mesagl.module.update()", 5);
    }
  }

  function pageDidUnload() {
    clearInterval(mesagl.updateInterval);
  }
</script>

</head>
<body id="bodyId" onunload="pageDidUnload();" >
  <h1>Mesa OpenGL Demo</h1>
  <p>
  You should see below a spinning multi-colored triangle.
  </p>
  <div id="mesagl_content"></div>
  <script type="text/javascript">
    contentDiv = document.getElementById('mesagl_content');
    // Load the published .nexe.  This includes the 'nexes' attribute which
    // shows how to load multi-architecture modules.  Each entry in the
    // table is a key-value pair: the key is the runtime ('x86-32',
    // 'x86-64', etc.); the value is a URL for the desired NaCl module.
    var nexes = 'x86-32: mesagl_x86_32.nexe\n'
                + 'x86-64: mesagl_x86_64.nexe\n'
                + 'arm: mesagl_arm.nexe ';
    contentDiv.innerHTML = '<embed name="mesagl_module" '
                           + 'id="mesagl" '
                           + 'width=512 height=512 '
                        // + 'nexes="' + nexes + '" '
                           + 'type="application/x-nacl-srpc" '
                           + 'dimensions="2" '
                           + 'onload=moduleDidLoad() />';
    // Note: this code is here to work around a bug in Chromium build
    // #47357.  See also
    // http://code.google.com/p/nativeclient/issues/detail?id=500
    document.getElementById('mesagl').nexes = nexes;
  </script>
</body>
</html>
